package ru.kantiana.accounting.rldata.core.rl.data;

import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;

/**
 * @author: Pavel Belevich
 * Date: 3/27/11
 * Time: 4:18 AM
 */
public class DocumentBuilderImpl implements DocumentBuilder {
    public Document buildDocument(RL rl) {
        Document document = new Document();
        document.add(new Field("number", rl.getNumber(), Field.Store.YES, Field.Index.NOT_ANALYZED));
        document.add(new Field("name", rl.getName(), Field.Store.YES, Field.Index.ANALYZED));
        document.add(new Field("text", rl.getText(), Field.Store.YES, Field.Index.NO));
        return document;
    }
}
